<!DOCTYPE HTML>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    	<title>统战成员学习平台</title>
	    <link rel="stylesheet" type="text/css" href="../../css/base.css" />
	    <link rel="stylesheet" type="text/css" href="../../css/style.css" />
		<style>
			.lesson_catalog.study > li div{
				line-height: 1rem;
				padding: 0.7rem 4rem .7rem 1rem;
			}
			.lesson_catalog > li .btn{
				position: absolute;
				right: .5rem;
				top: .3rem;
			}
			.lesson_catalog > li .btn.success{
				top: .4rem;
			}
			.lesson_catalog > li .score{
				position: absolute;
			    right: 3rem;
			    top: .3rem;
			}
		</style>
	</head>
	<body class="white">
		<div id="app" style="display:none" v-show="true">
			<div v-if="hasHeader" class="cata_header">目录<i @click="closeSide()" class="icon_close_big"></i></div>
			<ul class="lesson_catalog study">
				<li v-for="(item, index) of detail.catalogList" :class="{'active': activeIndex === index}">
					<i :class="activeIndex === index ? 'icon_s_close' : 'icon_s_open'"></i>
					<div class="ui_border_b" @click="collapse(index)">
						{{item.nodePName}}
						<span v-if="item.isQualified" class="btn success">已通过</span><span v-if="item.isQualified" class="score">{{item.score}}分</span>
						<span v-if="!item.isQualified && item.hasChapterExam && item.watchSectionFinished && (item.allNum === 0 || item.examNum < item.allNum)" @click.stop="exam(item.catalogPId, item.nodePName, 1)" class="btn">参加考试</span>
					</div>
					<ul>
						<li tapmode @click="studyThis(i)" v-for="i of item.childList" class="ui_border_b"><span class="point"></span>{{i.nodeName}}<span class="watchFinished" v-if="i.watchFinished">已学完</span></li>
					</ul>
				</li>
				<li v-if="detail.hasComprehensive">
					<div class="ui_border_b">
						<i class="icon_final_exam"></i>综合考试
						<span v-if="detail.couldFinalExam && (detail.allNum === 0 || detail.csomprehensiveNum < detail.allNum)" @click.stop="exam(null, '综合考试', 0)" class="btn">参加考试</span>
						<span v-if="detail.isQualified" class="btn success">已通过</span>
						<span v-if="detail.csomprehensiveScore" class="score">{{detail.csomprehensiveScore}}分</span>
					</div>
				</li>
			</ul>
		</div>
		<script type="text/javascript" src="../../script/api.js"></script>
		<script type="text/javascript" src="../../script/vue.min.js"></script>
		<script type="text/javascript" src="../../script/common.js"></script>
		<script type="text/javascript" src="../../script/layer_mobile/layer.js"></script>
		<script type="text/javascript">
		    new Vue({
				el: '#app',
		     	data: {
					courseId: 0,
					scheduleId: 0,
					leaningGroupsId: 0,
					hasHeader: false,
					activeIndex: -1,
					detail: {
        "couldFinalExam":0,
        "scheduleId":"cac45b05a97f416a970c7a6950801f96",
        "courseId":"a7f46afd833b45519efd44126192fdf3",
        "courseName":"十九大报告",
        "hasComprehensive":1,
        "csomprehensiveScore":null,
        "isQualified":null,
        "csomprehensiveNum":null,
        "allNum":0,
        "currentChapter":null,
        "leaningGroupsId":"ee4e6e1fe19c4edc923cec426650b5ee",
        "catalogList":[
            {
                "catalogPId":"6408d714b9964b4789cc06dabe3ac739",
                "nodePName":"第一章 开幕",
                "pOrder":0,
                "coverImages":"/opt/upload/courseware/file/timg.JPG",
                "hasChapterExam":0,
                "score":0,
                "isQualified":0,
                "examNum":null,
                "allNum":null,
                "isDoing":0,
                "childList":[
                    {
                        "catalogId":"0da931a7c93d4268a6e0392687afa1fe",
                        "nodeName":"第一节 开幕讲话",
                        "cOrder":0,
                        "coverCImages":"/opt/upload/courseware/file/timg.JPG",
                        "isFinished":0,
                        "isCDoing":0,
                        "beginLearnTime":"2017-11-23 22:08:19",
                        "lastLearnTime":"2017-11-23 22:08:23",
                        "progress":654000,
                        "watchFinished":1
                    }
                ],
                "fullmarks":null,
                "qualifiedScore":null,
                "watchSectionFinished":1
            },
            {
                "catalogPId":"0004ad78519c46f28be4d4ad052daeba",
                "nodePName":"第二章 讲话",
                "pOrder":1,
                "coverImages":"/opt/upload/courseware/file/timg.JPG",
                "hasChapterExam":0,
                "score":0,
                "isQualified":0,
                "examNum":null,
                "allNum":null,
                "isDoing":1,
                "childList":[
                    {
                        "catalogId":"5357389735db4762b35fefea837f6692",
                        "nodeName":"第一节 过去五年的工作和历史性变革（上）",
                        "cOrder":0,
                        "coverCImages":"/opt/upload/courseware/file/timg.JPG",
                        "isFinished":0,
                        "isCDoing":0,
                        "beginLearnTime":"2017-11-23 22:08:23",
                        "lastLearnTime":"2017-11-23 22:08:26",
                        "progress":1196000,
                        "watchFinished":1
                    },
                    {
                        "catalogId":"9873f84116c74e41a9aec061ea737399",
                        "nodeName":"第二节 过去五年的工作和历史性变革（下）",
                        "cOrder":1,
                        "coverCImages":"/opt/upload/courseware/file/xijinpingzongjieguoquwuniandegongzuoheli000627201710311625110.PNG",
                        "isFinished":0,
                        "isCDoing":0,
                        "beginLearnTime":"2017-11-23 22:08:26",
                        "lastLearnTime":"2017-11-23 22:08:29",
                        "progress":979000,
                        "watchFinished":1
                    },
                    {
                        "catalogId":"c32112f8ffaf4230b1b8f3285f5aff25",
                        "nodeName":"第三节 新时代中国共产党的历史使命",
                        "cOrder":2,
                        "coverCImages":"/opt/upload/courseware/file/xijinpingjianquanrenmindangjiazuozhuzhiduti000700201710311625240.PNG",
                        "isFinished":0,
                        "isCDoing":0,
                        "beginLearnTime":"2017-11-23 22:08:29",
                        "lastLearnTime":"2017-11-23 22:08:31",
                        "progress":880000,
                        "watchFinished":1
                    },
                    {
                        "catalogId":"9076bb31913c4d93a03f62a00968de3c",
                        "nodeName":"第四节 新时代中国特色社会主义思想和基本方略（上）",
                        "cOrder":3,
                        "coverCImages":"/opt/upload/courseware/file/timg.JPG",
                        "isFinished":0,
                        "isCDoing":0,
                        "beginLearnTime":"2017-11-23 22:08:31",
                        "lastLearnTime":"2017-11-23 22:08:35",
                        "progress":355000,
                        "watchFinished":1
                    },
                    {
                        "catalogId":"a4394b6ac80b4c41b0db2486a67c0503",
                        "nodeName":"第五节 新时代中国特色社会主义思想和基本方略（下）",
                        "cOrder":4,
                        "coverCImages":"/opt/upload/courseware/file/timg.JPG",
                        "isFinished":0,
                        "isCDoing":0,
                        "beginLearnTime":"2017-11-23 22:34:43",
                        "lastLearnTime":"2017-11-23 22:34:59",
                        "progress":1124000,
                        "watchFinished":1
                    },
                    {
                        "catalogId":"58e2f1a5beb84e33a2a3637b3cbc01c3",
                        "nodeName":"第六节 决胜全面建成小康社会，开启全面建设社会主义现代化国家新征程",
                        "cOrder":5,
                        "coverCImages":"/opt/upload/courseware/file/timg.JPG",
                        "isFinished":0,
                        "isCDoing":0,
                        "beginLearnTime":"2017-11-23 23:12:36",
                        "lastLearnTime":"2017-11-24 11:22:43",
                        "progress":556000,
                        "watchFinished":1
                    },
                    {
                        "catalogId":"9ce80485b05c4c90bb092384ffa8648f",
                        "nodeName":"第七节 贯彻新发展理念，建设现代化经济体系",
                        "cOrder":6,
                        "coverCImages":"/opt/upload/courseware/file/timg.JPG",
                        "isFinished":0,
                        "isCDoing":1,
                        "beginLearnTime":"2017-11-29 12:07:17",
                        "lastLearnTime":"2017-11-29 12:19:49",
                        "progress":0,
                        "watchFinished":0
                    },
                    {
                        "catalogId":"e9a149251d22406f8dafc0d6eeb7f41e",
                        "nodeName":"第八节 健全人民当家作主制度体系，发展社会主义民主政治",
                        "cOrder":7,
                        "coverCImages":"/opt/upload/courseware/file/xijinpingguanchexinfazhanlinianjianshexian000445201710311624510.PNG",
                        "isFinished":0,
                        "isCDoing":0,
                        "beginLearnTime":null,
                        "lastLearnTime":null,
                        "progress":null,
                        "watchFinished":0
                    },
                    {
                        "catalogId":"3876df191b6d40ac83df10987113de4a",
                        "nodeName":"第九节 坚定文化自信，推动社会主义文化繁荣兴盛.",
                        "cOrder":8,
                        "coverCImages":"/opt/upload/courseware/file/xijinpingjiandingwenhuazixintuidongshehui000703201710311624320.PNG",
                        "isFinished":0,
                        "isCDoing":0,
                        "beginLearnTime":null,
                        "lastLearnTime":null,
                        "progress":null,
                        "watchFinished":0
                    },
                    {
                        "catalogId":"11e63d06f5b4425194346f69b47e2e6c",
                        "nodeName":"第一十节 加快生态文明体制改革，建设美丽中国",
                        "cOrder":9,
                        "coverCImages":"/opt/upload/courseware/file/xijinpingtigaobaozhanghegaishanminshengshuiping000115201710311625490.PNG",
                        "isFinished":0,
                        "isCDoing":0,
                        "beginLearnTime":null,
                        "lastLearnTime":null,
                        "progress":null,
                        "watchFinished":0
                    },
                    {
                        "catalogId":"391379527ae44c43bd8233798dc0758e",
                        "nodeName":"第一十一节 坚持走中国特色强军之路，全面推进国防和军队现代化",
                        "cOrder":10,
                        "coverCImages":"/opt/upload/courseware/file/kangzhanshengli70zhounianyuebing0150903boshiwang.JPG",
                        "isFinished":0,
                        "isCDoing":0,
                        "beginLearnTime":null,
                        "lastLearnTime":null,
                        "progress":null,
                        "watchFinished":0
                    },
                    {
                        "catalogId":"490a158c2d12410cb2387dc54ac551e9",
                        "nodeName":"第一十二节 坚持“一国两制”，推进祖国统一",
                        "cOrder":11,
                        "coverCImages":"/opt/upload/courseware/file/timg.JPG",
                        "isFinished":0,
                        "isCDoing":0,
                        "beginLearnTime":null,
                        "lastLearnTime":null,
                        "progress":null,
                        "watchFinished":0
                    },
                    {
                        "catalogId":"bdddb9bba1fc40269a8296eda37bcbe8",
                        "nodeName":"第一十三节 坚持和平发展道路，推动构建人类命运共同体",
                        "cOrder":12,
                        "coverCImages":"/opt/upload/courseware/file/xijinpingjiandingwenhuazixintuidongshehui000703201710311624320.PNG",
                        "isFinished":0,
                        "isCDoing":0,
                        "beginLearnTime":null,
                        "lastLearnTime":null,
                        "progress":null,
                        "watchFinished":0
                    }
                ],
                "fullmarks":null,
                "qualifiedScore":null,
                "watchSectionFinished":0
            }
        ],
        "fullmarks":100,
        "qualifiedScore":80,
        "chapertWatchFinished":0,
        "scoreId":null
    }
		     	},
				mounted: function() {
		        	var $this = this;
		        	apiready = function() {
						$this.courseId = api.pageParam.courseId;
						$this.scheduleId = api.pageParam.scheduleId;
						$this.leaningGroupsId = api.pageParam.leaningGroupsId;
						$this.hasHeader = api.pageParam.hasHeader;
                        if($this.hasHeader) document.body.classList.remove('white');
						setTimeout(function() {
							var header = $api.dom('.cata_header');
							if(header) {
								$api.fixStatusBar(header);
							}
						}, 0)
						$this.init();
						api.addEventListener({
						    name: 'refresh_study_catalog_event'
						}, function(ret, err){
						    $this.init();
						});
                	}
		    	},
		    	methods: {
					init: function() {
						var $this = this;
						post('/client/learnCenter/queryScheduleCatalog', {
							courseId: $this.courseId,
							scheduleId: $this.scheduleId,
							leaningGroupsId: $this.leaningGroupsId
						}, function(ret) {
							$this.detail = ret.data;
						})
					},
					collapse: function(i) {
						this.activeIndex = this.activeIndex === i ? -1 : i
					},
					closeSide: function() {
						api.closeDrawerPane()
					},
					exam: function(catalogPId, name, type) {
						var $this = this;
						openWin('startExam_win', {
							courseId: $this.courseId,
							scheduleId: $this.scheduleId,
							leaningGroupsId: $this.leaningGroupsId,
							catalogId: catalogPId,
							type: type,
							name: name
						})
					},
					studyThis: function(item) {
						if(!(item.watchFinished === 1 || item.isCDoing === 1)) {
							msgUtil.toast({
							    msg: '本节还未开始学习'
							});
							return;
						}
						api.sendEvent({
						    name: 'study_new_chapter_event',
						    extra: {
						        catalogId: item.catalogId
						    }
						});
						api.closeDrawerPane()
					}
		    	}
		    });
		</script>
	</body>
</html>
